package DBComm;
import java.util.ArrayList;

//Dan Morgan

public class Configuration {
	private ArrayList<String> _configuration;
	//index 0 = _clientID;
	//index 1 = _tabFill;
	//index 2 =_tabStroke;
	//index 3 = _windowFill;
	//index 4 = _windowStroke;
	//index 5 = _chatWindowColor;
	//index 6 = _textColor;
	
	//Constructor
	public Configuration(){
		_configuration = new ArrayList<String>(7);
		//inserting dummy values because java is dumb
		for(int i = 0; i < 7; i++){
			_configuration.add(null);
		}
	}
	
	//Provide a field to update and the update value
	public void updateConfiguration(int index, String update){
		if(index >= 0 && index <= 6){
			_configuration.set(index, update);
		}
		else{
			System.err.println("Invalid input, please try again.");
		}
	}
	
	//if you want to get a specific configuration value, specify that field
	/*
	 * Commenting this out for now as I figure you can just get the configuration array list and specify the index you want, it'd be faster.
	public String getConfigurationSetting(String field){
		if(field.equals("clientID")){
			return _configuration.get(0);
		}
		else if(field.equals("tabFill")){
			return _configuration.get(1);
		}
		else if(field.equals("tabStroke")){
			return _configuration.get(2);
		}
		else if(field.equals("windowFill")){
			return _configuration.get(3);
		}
		else if(field.equals("windowStroke")){
			return _configuration.get(4);
		}
		else if(field.equals("chatWindowColor")){
			return _configuration.get(5);
		}
		else if(field.equals("textColor")){
			return _configuration.get(6);
		}
		else{
			System.err.println("Invalid input, please try again.");
			return field;
		}
	}
	*/
	
	public ArrayList<String> getConfiguration(){
		return _configuration;
	}

}
